<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Getting Started &mdash; Zapmenot 0.1 documentation</title>
      <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="_static/doctools.js"></script>
        <script src="_static/sphinx_highlight.js"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Material Library" href="materials.html" />
    <link rel="prev" title="Licence &amp; Disclaimer" href="license.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="index.html" class="icon icon-home"> Zapmenot
          </a>
              <div class="version">
                0.1
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="license.html">Licence &amp; Disclaimer</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#introduction">Introduction</a></li>
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="#quickstart">Quickstart</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="materials.html">Material Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="isotopes.html">Isotope Library</a></li>
<li class="toctree-l1"><a class="reference internal" href="modeling.html">Modeling in ZapMeNot</a></li>
<li class="toctree-l1"><a class="reference internal" href="results.html">Generating Results</a></li>
<li class="toctree-l1"><a class="reference internal" href="graphics.html">We Want Pictures!</a></li>
<li class="toctree-l1"><a class="reference internal" href="theory-and-methods.html">Theory and Methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="benchmarks.html">Benchmarking</a></li>
<li class="toctree-l1"><a class="reference internal" href="module-docs.html">Module Contents</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer.html">Developer</a></li>
<li class="toctree-l1"><a class="reference internal" href="version-history.html">Version History</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">Zapmenot</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home"></a></li>
      <li class="breadcrumb-item active">Getting Started</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/getting-started.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="getting-started">
<h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this heading"></a></h1>
<section id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this heading"></a></h2>
<p><cite>ZapMeNot</cite> is a Python library of functions used to perform photon (x-ray and gamma)
shielding analyses using the point-kernel method.  For a quick refresher on the point-kernel method or for more details
about this implementation, see the <a class="reference internal" href="theory-and-methods.html"><span class="doc">Theory and Methods</span></a> section.  For a more in-depth discussion of the point-kernel and other methods
of photon shielding, see <a class="reference external" href="https://www.ans.org/store/item-350021/">Radiation Shielding by J. K. Shultis and R. E. Faw</a>.</p>
<p>Photon sources in ZapMeNot can be created by specifying a composition of radioisotopes or
by including specific photon energies and intensities.  Photon energies may range from 15 keV to 15 MeV.
Source geometries may be point sources, line sources, or a range of volumetric sources.
The selection of isotopes that may be included in the source is vast,
covering all of the isotopes included in <a class="reference external" href="https://www.icrp.org/publication.asp?id=ICRP%20Publication%20107">ICRP Publication 107</a>.</p>
</section>
<section id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this heading"></a></h2>
<p>There are as many ways to install ZapMeNot as there are ways to install and run Python.  First
up is installing ZapMeNot using pip.</p>
<p>ZapMeNot can be installed directly from Github using pip:</p>
<p><code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">git+git://github.com/AlanFord/ZapMeNot.git</span></code></p>
<p>ZapMeNot can be installing from a local source tree using pip once the source has been retrieved from Github:</p>
<p><code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">./ZapMeNot</span></code></p>
<p>You can also install in Development Mode:</p>
<p><code class="code docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">-e</span> <span class="pre">./ZapMeNot</span></code></p>
<p>At present most ZapMeNot users are running ZapMeNot using either Anaconda or Miniconda.  Both use conda
to create specialized python environment tailored to the work at hand.  After installing either
Anaconda or Miniconda, create a ZapMeNot environment using the following command:</p>
<p><code class="code docutils literal notranslate"><span class="pre">conda</span> <span class="pre">env</span> <span class="pre">create</span> <span class="pre">-f</span> <span class="pre">zapmenot.yml</span></code></p>
<p>where the zapmenot.yml file contains the following:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">zapmenot</span>
<span class="nt">channels</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">defaults</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">conda-forge</span>
<span class="nt">dependencies</span><span class="p">:</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">python=3.9</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">scipy&gt;=0.14</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">numpy&gt;=1.18.1</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pyyaml&gt;=5.3</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pip</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">git</span>
<span class="c1"># optional for graphics capability</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pyvista</span>
<span class="c1"># optional for jupyterlab capability</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">jupyterlab</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">matplotlib</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">panel</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pythreejs</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pooch&gt;=1.6.0</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">ipyvtklink</span>
<span class="c1"># required for testing</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pytest</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">pandas</span>
<span class="c1"># required for developers</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sphinx-rtd-theme</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">sphinx</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">flake8</span>
<span class="p p-Indicator">-</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">build</span>
</pre></div>
</div>
<p>Finally, install the ZapMeNot package from Github:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>conda<span class="w"> </span>activate<span class="w"> </span>zapmenot
pip<span class="w"> </span>install<span class="w"> </span>git+git://github.com/AlanFord/ZapMeNot.git
</pre></div>
</div>
</section>
<section id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this heading"></a></h2>
<p>This is a “quick” introduction to ZapMeNot.  A more detailed description of
building an input file can be found in the <a class="reference internal" href="modeling.html"><span class="doc">Modeling in ZapMeNot</span></a> section.  A more in-depth
look at output options can be found in the <a class="reference internal" href="results.html"><span class="doc">Generating Results</span></a> section.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">zapmenot</span> <span class="kn">import</span> <span class="n">model</span><span class="p">,</span><span class="n">source</span><span class="p">,</span><span class="n">shield</span><span class="p">,</span><span class="n">detector</span><span class="p">,</span><span class="n">material</span>

<span class="n">sample_sink</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">Model</span><span class="p">()</span>

<span class="c1"># create the source</span>
<span class="n">a_source</span> <span class="o">=</span> <span class="n">source</span><span class="o">.</span><span class="n">PointSource</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
<span class="n">a_source</span><span class="o">.</span><span class="n">add_isotope_curies</span><span class="p">(</span><span class="s1">&#39;Co-60&#39;</span><span class="p">,</span><span class="mf">2.1</span><span class="p">)</span>
<span class="n">a_source</span><span class="o">.</span><span class="n">add_isotope_curies</span><span class="p">(</span><span class="s1">&#39;Cs-137&#39;</span><span class="p">,</span><span class="mf">0.3</span><span class="p">)</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">add_source</span><span class="p">(</span><span class="n">a_source</span><span class="p">)</span>

<span class="c1"># define the location where the dose will be calculated</span>
<span class="n">exposure_detector</span> <span class="o">=</span> <span class="n">detector</span><span class="o">.</span><span class="n">Detector</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">40</span><span class="p">,</span> <span class="n">z</span><span class="o">=</span><span class="mi">40</span><span class="p">)</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">add_detector</span><span class="p">(</span><span class="n">exposure_detector</span><span class="p">)</span>

<span class="c1"># define a shield and add it to the model</span>
<span class="n">first_shield</span> <span class="o">=</span> <span class="n">shield</span><span class="o">.</span><span class="n">SemiInfiniteXSlab</span><span class="p">(</span><span class="s1">&#39;concrete&#39;</span><span class="p">,</span> <span class="n">x_start</span><span class="o">=</span><span class="mi">12</span><span class="p">,</span> <span class="n">x_end</span><span class="o">=</span><span class="mf">32.1</span><span class="p">)</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">add_shield</span><span class="p">(</span><span class="n">first_shield</span><span class="p">)</span>

<span class="c1"># define a second shield and add it to the model</span>
<span class="n">second_shield</span> <span class="o">=</span> <span class="n">shield</span><span class="o">.</span><span class="n">SemiInfiniteXSlab</span><span class="p">(</span><span class="s1">&#39;iron&#39;</span><span class="p">,</span> <span class="n">x_start</span><span class="o">=</span><span class="mf">32.1</span><span class="p">,</span> <span class="n">x_end</span><span class="o">=</span><span class="mf">33.1</span><span class="p">)</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">add_shield</span><span class="p">(</span><span class="n">second_shield</span><span class="p">)</span>

<span class="c1"># declare which shield material will be used for buildup factor calculations</span>
<span class="n">buildup_factor_material</span> <span class="o">=</span> <span class="n">material</span><span class="o">.</span><span class="n">Material</span><span class="p">(</span><span class="s1">&#39;iron&#39;</span><span class="p">)</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">set_buildup_factor_material</span><span class="p">(</span><span class="n">buildup_factor_material</span><span class="p">)</span>

<span class="c1"># (optionally) declare a meterial to fill all non-defined regions</span>
<span class="n">sample_sink</span><span class="o">.</span><span class="n">set_filler_material</span><span class="p">(</span><span class="s1">&#39;air&#39;</span><span class="p">)</span>

<span class="c1"># calculate exposure in mR/hr</span>
<span class="n">exposure</span> <span class="o">=</span> <span class="n">sample_sink</span><span class="o">.</span><span class="n">calculate_exposure</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;The exposure is &#39;</span><span class="p">,</span> <span class="n">exposure</span><span class="p">,</span> <span class="s1">&#39; mR/hr&#39;</span><span class="p">)</span>
</pre></div>
</div>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="license.html" class="btn btn-neutral float-left" title="Licence &amp; Disclaimer" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="materials.html" class="btn btn-neutral float-right" title="Material Library" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2019 - 2023, Alan Ford..
      <span class="lastupdated">Last updated on Feb 12, 2023.
      </span></p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>